package io.renren.modules.testdatabase.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.renren.common.service.impl.CrudServiceImpl;
import io.renren.common.utils.ConvertUtils;
import io.renren.modules.testdatabase.dao.RiskEventSummaryDao;
import io.renren.modules.testdatabase.dto.RiskEventSummaryDTO;
import io.renren.modules.testdatabase.entity.RiskEventSummaryEntity;
import io.renren.modules.testdatabase.service.RiskEventSummaryService;
import cn.hutool.core.util.StrUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Arrays;
import java.util.List;
import java.util.Map;

/**
 * 风险事件总表
 *
 * @author Zyc 1227756953@qq.com
 * @since 1.0.0 2024-05-09
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class RiskEventSummaryServiceImpl extends CrudServiceImpl<RiskEventSummaryDao, RiskEventSummaryEntity, RiskEventSummaryDTO> implements RiskEventSummaryService {

    @Autowired
    RiskEventSummaryDao riskEventSummaryDao;

    @Override
    public QueryWrapper<RiskEventSummaryEntity> getWrapper(Map<String, Object> params){
        String id = (String)params.get("riskId");

        QueryWrapper<RiskEventSummaryEntity> wrapper = new QueryWrapper<>();
        wrapper.eq(StrUtil.isNotBlank(id), "riskId", id);

        return wrapper;
    }

    @Override
    public void deleteInfo(List<Long> ids){
        riskEventSummaryDao.deleteInfo(ids);
    }

    @Override
    public void updateInfo(RiskEventSummaryDTO riskEventSummaryDTO){
        riskEventSummaryDTO.getRiskId();
    }
}